export default function throttle(fn, delay) {
    let timer = null;
    return args => {
        if (!timer) {
            timer = setTimeout(() => {
                fn(args)
                timer = null
            }, delay);
        }
    }
}

export const throttleString = `function throttle(fn, delay) {
    let timer = null;
    return args => {
        if (!timer) {
            timer = setTimeout(() => {
                fn(args)
                timer = null
            }, delay);
        }
    }
}`